package com.ruoyi.flowable.service;

import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.flowable.domain.report.Condition;
import com.ruoyi.flowable.domain.FormField;
import com.ruoyi.flowable.domain.bo.FormDataBo;
import com.ruoyi.flowable.domain.vo.FormDataVo;

import java.io.IOException;
import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * 单提交数据Service接口
 *
 * @author zxw
 * @date 2023-03-28
 */
public interface IFormDataService {

    /**
     * 查询单提交数据
     */
    FormDataVo queryById(Long dataId);

    /**
     * 查询单提交数据列表
     */
    TableDataInfo<FormDataVo> queryPageList(FormDataBo bo, PageQuery pageQuery);

    /**
     * 查询单提交数据列表
     */
    List<FormDataVo> queryList(FormDataBo bo);

    /**
     * 新增单提交数据
     */
    Boolean insertByBo(FormDataBo bo);

    /**
     * 修改单提交数据
     */
    Boolean updateByBo(FormDataBo bo);

    /**
     * 校验并批量删除单提交数据信息
     */
    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);

    FormDataVo selectFormDataByInstId(String procInstId);

    void asyncSaveData(FormDataBo formData) throws IOException;

    int updateMapData(String tableName, Map<String, Object> formData);

    int deleteMapData(String tableName, Long dataId);

    List<Map<String, Object>> getDataPage(String tableName, String fileds, List<Condition> conds, int offset, int limit);

    int getDataCount(String tableName, List<Condition> conds);

    List<Map<String, Object>> getDataList(String tableName, String fileds, List<Condition> conds);

    List<FormField> getTableColumn(String tableName);

    Map<String, Object> getDataInfo(String tableName, Long id);

}
